Skip to content

Cfml language support#1118

Closed
ghedwards wants to merge 2 commits into
colbymchenry:mainfrom
cfmleditor:cfml-language-support
Closed

Cfml language support#1118
ghedwards wants to merge 2 commits into
colbymchenry:mainfrom
cfmleditor:cfml-language-support

Conversation

@ghedwards

Copy link
Copy Markdown
Contributor

No description provided.

claude added 2 commits June 30, 2026 05:30
Adds CodeGraph extraction for ColdFusion Markup Language using
tree-sitter-cfml's cfml and cfscript grammars. Handles both the legacy
tag-based style (<cfcomponent>/<cffunction>) and modern bare-script
style (component { ... }), delegating embedded <cfscript> tag bodies
to the cfscript grammar. .cfs files are routed through the same
extractor so anonymous component names fall back to the filename
consistently across both extensions, since CFML never declares a
component's name in source.

Includes extraction tests covering both dialects, extends/implements,
visibility, and regression coverage for the implicit-end-tag walk and
file-node containment.
… cfquery SQL bodies

A <cfscript> block nested inside control-flow tags (<cfif>/<cfloop>/<cftry>)
inside a <cffunction> or at top-level component scope was silently skipped:
the implicit-end-tag walk only checked direct children/siblings for
cf_script_tag, missing it when wrapped a level deeper. A new recursive
delegateNestedTags helper finds <cfscript>/<cfquery> at any depth without
descending into nested <cffunction> scopes.

<cfquery> SQL bodies were also entirely unhandled - the cf_query_content
node's text was opaque raw SQL, so any #hash# expression inside it (e.g. a
call like #getCurrentUser().getId()# in a WHERE clause) was dropped. Wires
the tree-sitter-cfml cfquery grammar in as a new minimal Language/extractor
(call expressions only - the grammar models no other CodeGraph symbols) and
delegates <cfquery> bodies to it the same way <cfscript> bodies are
delegated to the cfscript grammar.
colbymchenry added a commit that referenced this pull request Jul 2, 2026
…1153)

Tag-based and bare-script CFML, extends/implements, <cfscript>/<cfquery> delegation, BOM + unquoted-attribute handling. Wasm grammars verified bit-for-bit reproducible from cfmleditor/tree-sitter-cfml. Validated on FW/1, ColdBox, CFWheels. Follow-up: #1152.

Co-authored-by: ghedwards <125586+ghedwards@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@colbymchenry

Copy link
Copy Markdown
Owner

Thank you for this — reviewed and merged today via #1153 (your branch doesn't allow maintainer edits, so I couldn't push the review fixes to this PR directly; your commits carry over and the squash commit credits you as co-author).

The review verified the wasm grammars are bit-for-bit reproducible from cfmleditor/tree-sitter-cfml (nice to see the grammar and the integration maintained by the same org), and the extractor held up well on real code — FW/1, ColdBox, and CFWheels all index with effectively 100% component coverage. Three fixes were added on top:

  • a leading UTF-8 BOM made the tag-vs-script sniffer misroute tag-based files to the cfscript grammar (17% of ColdBox's files extracted nothing) — the sniffer now skips it
  • unquoted attribute values (<cffunction name=init>) were dropped; tagAttr now reads both value shapes
  • functions in a component-level <cfscript> block now classify as method (the ModuleConfig shape)

One follow-up worth knowing about if you want to keep going — #1152: dotted-path extends="coldbox.system.web.Controller" doesn't resolve to the class node yet, which hides most inheritance on ColdBox-style apps. The extraction side you built is done; it needs a CFML-aware step in reference resolution.

CFML ships in the next release. Thanks again — closing this in favor of #1153.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants